@extends('layout.master')

@section('title', '后台管理系统')

@section('content')

    <style>

        body{background-color: white !important;background-image: none}

    </style>

<div class="container">
    <h1>用户<span style="color: orange">{{ Session::get('mgname') }}</span>欢迎您进入系统</h1>
    <h1>今天是:</h1>
    <h2 id="date"></h2>

    <h3>当前IP地址:{{$ip}}</h3>
</div>
<style>
.container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

h1, h2 {
  text-align: center;
}
</style>
<script>
function updateDate() {
  var dateElement = document.getElementById("date");
  var currentDate = new Date();

  var year = currentDate.getFullYear();
  var month = currentDate.getMonth() + 1;
  var day = currentDate.getDate();
  var hours = currentDate.getHours();
  var minutes = currentDate.getMinutes();
  var seconds = currentDate.getSeconds();
  var dayOfWeek = currentDate.getDay();

  var weekDays = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
  var dateString = year + "年" + month + "月" + day + "日 " + hours + ":" + minutes + ":" + seconds + " " + weekDays[dayOfWeek];

  dateElement.textContent = dateString;
}

// 页面加载完成后更新日期
window.onload = function() {
  updateDate();
};
</script>
@endsection

